/**
 * NormalPathSegment.java
 * 2016年6月4日
 * ©2015 北京特微智能科技有限公司. All rights reserved.
 */
package cn.trawe.pathmappingtree;

/**
 * 常规Path片段，用于精确匹配
 * 
 * @author wangda
 */
public class NormalPathSegment extends PathSegment {
    
    private String segment = "";
    
    public NormalPathSegment(String segment) {
        this.segment = segment;
    }
    
    @Override
    public PathSegmentType getType() {
        return PathSegmentType.NORMAL;
    }

    @Override
    public boolean isMatched(String matchStr) {
        return segment.equals(matchStr);
    }

    @Override
    public boolean isSameSegment(String segStr) {
        segStr = segStr == null? "": segStr;
        return segment.equals(segStr);
    }

    @Override
    public String getValue() {
        return this.segment;
    }
}
